<?php use_helper('PA_Links') ?>
<?php if(isset($form) && !isset($form['no_items'])): ?>
<?php echo $form->renderFormTag(link_to_app('Store', 'createWz'), array('id' => 'wzForm')) ?>
<?php echo $form->renderHiddenFields() ?>
<table id="wzTable" style="display: inline-table">
  <tr>
    <th><?php echo $form['project_id']->renderLabel() ?></th>
    <td colspan="3"><?php echo $form['project_id']->render() ?></td>
  </tr>
  <tr>
    <th>Uwaga</th>
    <td colspan="3"><?php echo $form['annotation']->render() ?></td>
  </tr>
  <tr>
    <th>Lp</th>
    <th style="min-width: 250px;">Materiał</th>
    <th>Ilość [<?php if(isset($quantityUnit)) echo $quantityUnit ?>]</th>
    <th><img src="/images/icons/add.png" width="16" height="16" class="middle" onclick="App.Table.addDemandRow(this, false, true)" /></th>
  </tr>
  <tr id="item_1">
    <td><p id="counter"/></td>
    <td><?php echo $form['items_list']->render() ?></td>
    <td><?php echo $form['items_list_values']->render(array('size' => '5')) ?></td>
    <td></td>
  </tr>
  <tr>
    <td colspan="4">
      <input type="button" value="Zapisz" onclick="App.Form.validateWZ('select[name*=wz][onchange]', 'input[type=text][id*=items_list_values]', '<?php echo link_to_app('Store',  'checkItemQuantity') ?>')" />
    </td>
  </tr>
</table
<?php elseif(isset($error)): ?>
  <?php echo $error ?>
<?php else: ?>
  Brak pozycji w magazynie.
<?php endif; ?>